package cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts;

import org.eclipse.draw2d.FigureUtilities;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess;

import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.part.ComponentBasedSystemVisualIDRegistry;

/**
 * @generated
 */
public class ComponentBasedSystemEditPartFactory implements EditPartFactory {

	/**
	 * @generated
	 */
	public EditPart createEditPart(EditPart context, Object model) {
		if (model instanceof View) {
			View view = (View) model;
			switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {

			case ModelEditPart.VISUAL_ID:
				return new ModelEditPart(view);

			case SimpleComponentEditPart.VISUAL_ID:
				return new SimpleComponentEditPart(view);

			case SimpleComponentNameEditPart.VISUAL_ID:
				return new SimpleComponentNameEditPart(view);

			case SimpleComponentStereotypeEditPart.VISUAL_ID:
				return new SimpleComponentStereotypeEditPart(view);

			case CompositeComponentEditPart.VISUAL_ID:
				return new CompositeComponentEditPart(view);

			case CompositeComponentNameEditPart.VISUAL_ID:
				return new CompositeComponentNameEditPart(view);

			case CompositeComponentStereotypeEditPart.VISUAL_ID:
				return new CompositeComponentStereotypeEditPart(view);

			case ArtifactEditPart.VISUAL_ID:
				return new ArtifactEditPart(view);

			case ArtifactNameEditPart.VISUAL_ID:
				return new ArtifactNameEditPart(view);

			case ArtifactStereotypeEditPart.VISUAL_ID:
				return new ArtifactStereotypeEditPart(view);

			case InterfaceEditPart.VISUAL_ID:
				return new InterfaceEditPart(view);

			case InterfaceNameEditPart.VISUAL_ID:
				return new InterfaceNameEditPart(view);

			case SimpleComponent2EditPart.VISUAL_ID:
				return new SimpleComponent2EditPart(view);

			case SimpleComponentName2EditPart.VISUAL_ID:
				return new SimpleComponentName2EditPart(view);

			case SimpleComponentStereotype2EditPart.VISUAL_ID:
				return new SimpleComponentStereotype2EditPart(view);

			case CompositeComponent2EditPart.VISUAL_ID:
				return new CompositeComponent2EditPart(view);

			case CompositeComponentName2EditPart.VISUAL_ID:
				return new CompositeComponentName2EditPart(view);

			case CompositeComponentStereotype2EditPart.VISUAL_ID:
				return new CompositeComponentStereotype2EditPart(view);

			case Interface2EditPart.VISUAL_ID:
				return new Interface2EditPart(view);

			case InterfaceName2EditPart.VISUAL_ID:
				return new InterfaceName2EditPart(view);

			case ProvidingPortEditPart.VISUAL_ID:
				return new ProvidingPortEditPart(view);

			case ProvidingPortNameEditPart.VISUAL_ID:
				return new ProvidingPortNameEditPart(view);

			case WrappingLabelEditPart.VISUAL_ID:
				return new WrappingLabelEditPart(view);

			case RequiringPortEditPart.VISUAL_ID:
				return new RequiringPortEditPart(view);

			case RequiringPortNameEditPart.VISUAL_ID:
				return new RequiringPortNameEditPart(view);

			case WrappingLabel2EditPart.VISUAL_ID:
				return new WrappingLabel2EditPart(view);

			case CompositeComponentCompositeComponentCompartmentEditPart.VISUAL_ID:
				return new CompositeComponentCompositeComponentCompartmentEditPart(
						view);

			case CompositeComponentCompositeComponentCompartment2EditPart.VISUAL_ID:
				return new CompositeComponentCompositeComponentCompartment2EditPart(
						view);

			case DependencyEditPart.VISUAL_ID:
				return new DependencyEditPart(view);

			case DependencyNameEditPart.VISUAL_ID:
				return new DependencyNameEditPart(view);

			case DependencyStereotypeEditPart.VISUAL_ID:
				return new DependencyStereotypeEditPart(view);

			case ManifestationEditPart.VISUAL_ID:
				return new ManifestationEditPart(view);

			case ManifestationNameEditPart.VISUAL_ID:
				return new ManifestationNameEditPart(view);

			case WrappingLabel3EditPart.VISUAL_ID:
				return new WrappingLabel3EditPart(view);

			case RealizationEditPart.VISUAL_ID:
				return new RealizationEditPart(view);

			case RealizationNameEditPart.VISUAL_ID:
				return new RealizationNameEditPart(view);

			case UsageEditPart.VISUAL_ID:
				return new UsageEditPart(view);

			case UsageNameEditPart.VISUAL_ID:
				return new UsageNameEditPart(view);

			case GeneralizationEditPart.VISUAL_ID:
				return new GeneralizationEditPart(view);

			case GeneralizationNameEditPart.VISUAL_ID:
				return new GeneralizationNameEditPart(view);

			case DelegateEditPart.VISUAL_ID:
				return new DelegateEditPart(view);

			}
		}
		return createUnrecognizedEditPart(context, model);
	}

	/**
	 * @generated
	 */
	private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
		// Handle creation of unrecognized child node EditParts here
		return null;
	}

	/**
	 * @generated
	 */
	public static CellEditorLocator getTextCellEditorLocator(
			ITextAwareEditPart source) {
		return CellEditorLocatorAccess.INSTANCE
				.getTextCellEditorLocator(source);
	}

}
